﻿using System.Threading;

namespace GameName1
{
    internal class WeaponStateReloading : WeaponState
    {
        public WeaponStateReloading(Weapon weapon)
        {
            var t = new Thread(()=>Reload(weapon));
            t.Start();
        }

        public override void Fire(Weapon weapon, Projectile p)
        {
            //nope
        }

        private void Reload(Weapon weapon)
        {
            Thread.Sleep((int) weapon.ReloadTime);   
            weapon.WeaponState = new WeaponStateReady();
        }
}
}
